﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using System.Web.Mvc;
using SportsStore.WebUI.Models;
using SportsStore.WebUI.HtmlHelpers;
namespace SportsStore.UnitTests
{
    [TestFixture]
    public class DisplayingPageLinks
    {
        [Test]
        public void Can_Generate_Links_To_Other_Pages()
        {
            HtmlHelper html = null;
            PagingInfo pagingInfo = new PagingInfo 
            {
             CurrentPage =2,  TotalItems=28, ItemPerPage=10
            };
            Func<int, string> pageUrl = i => "Page" + i.ToString();
            MvcHtmlString result = html.PageLinks(pagingInfo, pageUrl);
            result.ToString().ShouldEqual(@"<a href=""Page1"">1</a>
<a class=""selected"" href=""Page2"">2</a>
<a href=""Page3"">3</a>
");
        }
    }
}
